/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp, otherHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PLMDocDistribution extends BasicModel<PLMDocDistribution> {
  cputoutid?: number; // 标识
  creatorid?: string; // 发放人员ID
  cobjectid?: string; // 被发放人员ID
  cobjecttype?: string; // 被发放者类型
  cputouttime?: string; // 发放时间
  cvalidtime?: string; // 生效时间
  ctrashtime?: string; // 失效时间
  cpriviligeid?: number; // 发放的权限ID
  cisvalid?: number; // 是否失效
  cputoutpakageid?: number; // 发放对象包ID
  cdetail?: string; // 备注
  issuednumber?: string; // issuednumber
  noticenumber?: string; // noticenumber
  downoriginalfile?: string; // downoriginalfile
  downpdffile?: string; // downpdffile
}

export const pLMDocDistributionList = (params?: PLMDocDistribution | any) =>
  defHttp.get<PLMDocDistribution>({ url: adminPath + '/plm/doc/pLMDocDistribution/list', params });

export const pLMDocDistributionListData = (params?: PLMDocDistribution | any) =>
  defHttp.post<Page<PLMDocDistribution>>({
    url: adminPath + '/plm/doc/pLMDocDistribution/listData',
    params,
  });

export const pLMDocDistributionForm = (params?: PLMDocDistribution | any) =>
  defHttp.get<PLMDocDistribution>({ url: adminPath + '/plm/doc/pLMDocDistribution/form', params });

export const pLMDocDistributionSave = (params?: any, data?: PLMDocDistribution | any) =>
  defHttp.postJson<PLMDocDistribution>({
    url: adminPath + '/plm/doc/pLMDocDistribution/save',
    params,
    data,
  });

export const pLMDocDistributionDelete = (params?: PLMDocDistribution | any) =>
  defHttp.get<PLMDocDistribution>({
    url: adminPath + '/plm/doc/pLMDocDistribution/delete',
    params,
  });

export const getDocPrivilige = (params?: PLMDocDistribution | any) =>
  defHttp.post<Page<PLMDocDistribution>>({
    url: adminPath + '/plm/doc/pLMDocDistribution/getDocPrivilige',
    params,
  });

export const listData = (params?: PLMDocDistribution | any, data?: PLMDocDistribution | any) =>
  otherHttp.post<Page<PLMDocDistribution>>({
    url: '/rest/preview/getOutPutDoc',
    params,
    data,
    baseURL: '',
  });
